Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[META] - Converted EuiCardGraphic to TS + tests #1751

Merged
merged 5 commits into from
Mar 21, 2019
Merged

[META] - Converted EuiCardGraphic to TS + tests #1751

merged 5 commits into from
Mar 21, 2019

Conversation

theodesp
Copy link
Contributor

@theodesp theodesp commented Mar 21, 2019

Summary

As per #1557, I converted the EuiCardGraphic to TS.

Checklist

  • This was checked in mobile
  • This was checked in IE11
  • This was checked in dark mode
  • Any props added have proper autodocs
  • Documentation examples were added
  • A changelog entry exists and is marked appropriately
  • This was checked for breaking changes and labeled appropriately
  • Jest tests were updated or added to match the most common scenarios
  • This was checked against keyboard-only and screenreader scenarios
  • This required updates to Framer X components

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@@ -3,7 +3,7 @@
/// <reference path="./button/index.d.ts" />
/// <reference path="./call_out/index.d.ts" />
/// <reference path="./code/index.d.ts" />
/// <reference path="./combo_box/index.d.ts" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

combo_box was referenced twice here

@theodesp
Copy link
Contributor Author

All comments welcome

color = 'blue',
}) => {
// Set the svg gradient colors
// @ts-ignore
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ts complains here for posible undefined

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to add a ! before the .start, .end, and .path accesses -

const graphicStartColor: string = graphicColorsToCodes.find(
    w => w.color === color
  )!.start;

The ! assures Typescript the object does exist, while not suppressing any other potential errors with ts-ignore.

@theodesp
Copy link
Contributor Author

I've updated my PR to resolve conflicts

Copy link
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small nit pick

color = 'blue',
}) => {
// Set the svg gradient colors
// @ts-ignore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to add a ! before the .start, .end, and .path accesses -

const graphicStartColor: string = graphicColorsToCodes.find(
    w => w.color === color
  )!.start;

The ! assures Typescript the object does exist, while not suppressing any other potential errors with ts-ignore.

@chandlerprall
Copy link
Contributor

Thanks for putting this together!

@theodesp
Copy link
Contributor Author

Cool, I didn't knew that trick. I will update the PR. Thanx.

@chandlerprall
Copy link
Contributor

jenkins test this

Copy link
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM; I'll wait for CI to go green and then merge this in.

@chandlerprall chandlerprall merged commit a38c659 into elastic:master Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants